<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>prencar: Command Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  <td id="projectlogo"><img alt="Logo" src="prencar.png"/></td>
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">prencar
   &#160;<span id="projectnumber">1</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.8.0 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('class_command.html','');
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a> &#124;
<a href="#pri-methods">Private Member Functions</a> &#124;
<a href="#pri-static-attribs">Static Private Attributes</a>  </div>
  <div class="headertitle">
<div class="title">Command Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>A <a class="el" href="class_command.html" title="A Command object represents a command sent from the host software.">Command</a> object represents a command sent from the host software.  
 <a href="class_command.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="_command_8h_source.html">Command.h</a>&gt;</code></p>

<p><a href="class_command-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a18df2d81039392daeb0b78c346a70537"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_command.html#a18df2d81039392daeb0b78c346a70537">Command</a> ()</td></tr>
<tr class="memitem:adbc9f2539741be419397502840f3740c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_command.html#adbc9f2539741be419397502840f3740c">parse</a> (byte *commandString)</td></tr>
<tr><td colspan="2"><h2><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:a31842ee183ae2cd06ce6ad8f7533ff02"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_command.html#a31842ee183ae2cd06ce6ad8f7533ff02">commandCode</a></td></tr>
<tr class="memitem:a213973ca7ffaf1385a959ceab49f5065"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_command.html#a213973ca7ffaf1385a959ceab49f5065">parameters</a> [<a class="el" href="class_command.html#af0aca7db3a739923260c8a8a35820b7f">_COMMANDMAXPARAMETERAMOUNT</a>]</td></tr>
<tr class="memitem:adc423454c3b30e6b2fe33f8a84ff9fde"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_command.html#adc423454c3b30e6b2fe33f8a84ff9fde">amountOfParameters</a></td></tr>
<tr><td colspan="2"><h2><a name="pri-methods"></a>
Private Member Functions</h2></td></tr>
<tr class="memitem:ad23d2c8f8c6c24b71bae06c5aefcc537"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_command.html#ad23d2c8f8c6c24b71bae06c5aefcc537">copyBytesUntil</a> (byte *const source, int sourceStart, byte *target, int targetSize, byte stopCharacter)</td></tr>
<tr><td colspan="2"><h2><a name="pri-static-attribs"></a>
Static Private Attributes</h2></td></tr>
<tr class="memitem:af0aca7db3a739923260c8a8a35820b7f"><td class="memItemLeft" align="right" valign="top">static int const&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_command.html#af0aca7db3a739923260c8a8a35820b7f">_COMMANDMAXPARAMETERAMOUNT</a> = 20</td></tr>
<tr class="memdesc:af0aca7db3a739923260c8a8a35820b7f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Defines, how many parameters a command can have.  <a href="#af0aca7db3a739923260c8a8a35820b7f"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>A <a class="el" href="class_command.html" title="A Command object represents a command sent from the host software.">Command</a> object represents a command sent from the host software. </p>
<p>The commands are transmitted as lines over the serial interface. Each command is transmitted on one line (\n). After a line is ready to be parsed a <a class="el" href="class_command.html" title="A Command object represents a command sent from the host software.">Command</a> object is created out of it. A command has always to be transmitted in the following format:<br/>
 <code>202-4:12,323,4399,2292\n</code><br/>
 <code>[messageId]-[sizeOfParameters]:[parameter 1],[parameter 2],[parameter 3],[parameter n]\n</code></p>
<p>If there arent any parameters the command would look like this:<br/>
 <code>205-0:\n</code></p>
<h3>Possible Commands</h3>
<p>Below all possible commands are listed. </p>
<table class="doxtable">
<tr>
<th>Code</th><th>Name</th><th>Parameters</th><th>Description </th></tr>
<tr>
<td>100</td><td>Send current configuration</td><td>-</td><td>Tell the MC to send the whole configuration over the serial interface. </td></tr>
<tr>
<td>101</td><td>Update configuration</td><td>See <a class="el" href="class_configuration.html#a13c417c35f720cae9917b7bed7ceb159">Configuration::updateConfiguration()</a></td><td>Updates the configuration of the microcontroller with the given parameters. </td></tr>
<tr>
<td>200</td><td>Calibrate line sensors</td><td>-</td><td>Starts the calibration of the line sensors. </td></tr>
<tr>
<td>201</td><td>Set state of <a class="el" href="class_sensor_debug.html">SensorDebug</a> module</td><td>1 --&gt; set module on</td><td>If enabled (parameter[0] = 1) the sensor debug module sends different sensor measurements in regular intervals. </td></tr>
<tr>
<td>300</td><td>Start parcours</td><td>State to start from as int number (first state = 0). <dl class="section see"><dt>See also:</dt><dd><a class="el" href="_state_maschine_8h.html#ad5f3c64cf1a6afd0af12270f4a539ce8">TParcoursState</a></dd></dl>
</td><td>Starts the parcours </td></tr>
<tr>
<td>301</td><td>Stop parcours</td><td>-</td><td>Stops the parcours and the car performing a fast stop. </td></tr>
<tr>
<td>400</td><td>Control car</td><td>speedLeft, direction Left, speedRight, direction Right</td><td>Speed between 0-255; direction: 0 - phaseOut, 1 - forwards, 2 - backwards, 3 - fastStop </td></tr>
<tr>
<td>401</td><td>Control hoist</td><td>hoist position (pwm value between 0-255)</td><td></td></tr>
</table>

<p>Definition at line <a class="el" href="_command_8h_source.html#l00033">33</a> of file <a class="el" href="_command_8h_source.html">Command.h</a>.</p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a18df2d81039392daeb0b78c346a70537"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_command.html#a18df2d81039392daeb0b78c346a70537">Command::Command</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Creates a new command object. </p>

<p>Definition at line <a class="el" href="_command_8cpp_source.html#l00006">6</a> of file <a class="el" href="_command_8cpp_source.html">Command.cpp</a>.</p>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="ad23d2c8f8c6c24b71bae06c5aefcc537"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="class_command.html#ad23d2c8f8c6c24b71bae06c5aefcc537">Command::copyBytesUntil</a> </td>
          <td>(</td>
          <td class="paramtype">byte *const&#160;</td>
          <td class="paramname"><em>source</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>sourceStart</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">byte *&#160;</td>
          <td class="paramname"><em>target</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>targetSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">byte&#160;</td>
          <td class="paramname"><em>stopCharacter</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_command_8cpp_source.html#l00053">53</a> of file <a class="el" href="_command_8cpp_source.html">Command.cpp</a>.</p>

<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="class_command_ad23d2c8f8c6c24b71bae06c5aefcc537_icgraph.png" border="0" usemap="#class_command_ad23d2c8f8c6c24b71bae06c5aefcc537_icgraph" alt=""/></div>
<map name="class_command_ad23d2c8f8c6c24b71bae06c5aefcc537_icgraph" id="class_command_ad23d2c8f8c6c24b71bae06c5aefcc537_icgraph">
<area shape="rect" id="node3" href="class_command.html#adbc9f2539741be419397502840f3740c" title="Command::parse" alt="" coords="233,5,354,32"/><area shape="rect" id="node5" href="class_communication.html#ad566d07485df1c7970edd450723da1aa" title="Communication::parseAndPutCommandOnList" alt="" coords="403,5,695,32"/><area shape="rect" id="node7" href="class_communication.html#ab405d4412e7f2515e4fdc2e61a8d5963" title="Communication::doJob" alt="" coords="744,5,899,32"/></map>
</div>
</p>

</div>
</div>
<a class="anchor" id="adbc9f2539741be419397502840f3740c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="class_command.html#adbc9f2539741be419397502840f3740c">Command::parse</a> </td>
          <td>(</td>
          <td class="paramtype">byte *&#160;</td>
          <td class="paramname"><em>commandString</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Parses a line and saves the content to the membervariables </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">commandString</td><td>The start position of the command string. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_command_8cpp_source.html#l00015">15</a> of file <a class="el" href="_command_8cpp_source.html">Command.cpp</a>.</p>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="class_command_adbc9f2539741be419397502840f3740c_cgraph.png" border="0" usemap="#class_command_adbc9f2539741be419397502840f3740c_cgraph" alt=""/></div>
<map name="class_command_adbc9f2539741be419397502840f3740c_cgraph" id="class_command_adbc9f2539741be419397502840f3740c_cgraph">
<area shape="rect" id="node3" href="class_command.html#ad23d2c8f8c6c24b71bae06c5aefcc537" title="Command::copyBytesUntil" alt="" coords="177,5,354,32"/></map>
</div>
</p>

<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="class_command_adbc9f2539741be419397502840f3740c_icgraph.png" border="0" usemap="#class_command_adbc9f2539741be419397502840f3740c_icgraph" alt=""/></div>
<map name="class_command_adbc9f2539741be419397502840f3740c_icgraph" id="class_command_adbc9f2539741be419397502840f3740c_icgraph">
<area shape="rect" id="node3" href="class_communication.html#ad566d07485df1c7970edd450723da1aa" title="Communication::parseAndPutCommandOnList" alt="" coords="177,5,469,32"/><area shape="rect" id="node5" href="class_communication.html#ab405d4412e7f2515e4fdc2e61a8d5963" title="Communication::doJob" alt="" coords="517,5,672,32"/></map>
</div>
</p>

</div>
</div>
<hr/><h2>Member Data Documentation</h2>
<a class="anchor" id="af0aca7db3a739923260c8a8a35820b7f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int const <a class="el" href="class_command.html#af0aca7db3a739923260c8a8a35820b7f">Command::_COMMANDMAXPARAMETERAMOUNT</a> = 20<code> [static, private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Defines, how many parameters a command can have. </p>

<p>Definition at line <a class="el" href="_command_8h_source.html#l00037">37</a> of file <a class="el" href="_command_8h_source.html">Command.h</a>.</p>

</div>
</div>
<a class="anchor" id="adc423454c3b30e6b2fe33f8a84ff9fde"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="class_command.html#adc423454c3b30e6b2fe33f8a84ff9fde">Command::amountOfParameters</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_command_8h_source.html#l00043">43</a> of file <a class="el" href="_command_8h_source.html">Command.h</a>.</p>

</div>
</div>
<a class="anchor" id="a31842ee183ae2cd06ce6ad8f7533ff02"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="class_command.html#a31842ee183ae2cd06ce6ad8f7533ff02">Command::commandCode</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_command_8h_source.html#l00041">41</a> of file <a class="el" href="_command_8h_source.html">Command.h</a>.</p>

</div>
</div>
<a class="anchor" id="a213973ca7ffaf1385a959ceab49f5065"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="class_command.html#a213973ca7ffaf1385a959ceab49f5065">Command::parameters</a>[<a class="el" href="class_command.html#af0aca7db3a739923260c8a8a35820b7f">_COMMANDMAXPARAMETERAMOUNT</a>]</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_command_8h_source.html#l00042">42</a> of file <a class="el" href="_command_8h_source.html">Command.h</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>D:/Workspace/Arduino/prencar/<a class="el" href="_command_8h_source.html">Command.h</a></li>
<li>D:/Workspace/Arduino/prencar/<a class="el" href="_command_8cpp_source.html">Command.cpp</a></li>
</ul>
</div><!-- contents -->
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="class_command.html">Command</a>      </li>

    <li class="footer">Generated on Thu Apr 26 2012 09:42:56 for prencar by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.0 </li>
   </ul>
 </div>


</body>
</html>
